﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
namespace QL_KHACHSAN
{
    public partial class frmPhong : Office2007Form
    {
        public frmPhong()
        {
            InitializeComponent();
            string strTag = Convert.ToString(this.Tag);
            clsMain.flexConn.InitForms(strTag, ref fcListView);
            clsMain.flexConn.InitForms(strTag, ref fctxtMaso);
            clsMain.flexConn.InitForms(strTag, ref fctxtTen);
            clsMain.flexConn.InitForms(strTag, ref fctxtGiaPhong);
            clsMain.flexConn.InitForms(strTag, ref fctxtViTriTang);
            clsMain.flexConn.InitForms(strTag, ref fctxtLoaiPhong);
        }

        private void fcButton_Click(object sender, EventArgs e)
        {
            try
            {
                clsMain.flexConn.fcButton_Click(Convert.ToString(this.Tag), ref fcButton, clsMain.flexConn.fcConn);
            }
            catch (Exception ex)
            {
                MessageBox.Show(clsMain.STR_ERROR + ex.ToString());
            }
        }

        private void fcListView_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                fcButton.ChangeState(FlexControls.flexControls.STATE_UPDATE);
                clsMain.flexConn.AddDataToControll(fcListView.strSelectItemCode, Convert.ToString(this.Tag), clsMain.flexConn.fcConn);
            }
            catch (Exception ex)
            {
                MessageBox.Show(clsMain.STR_ERROR + ex.ToString());
            }
        }
    }
}
